<div class="row">
    <ol class="breadcrumb">
        <li><a href="{{prefix}}index.html"><span class="iconfont icon-shouye mr-10"></span>当前位置:优农后台</a></li>
        <li class="active">{{model === 'add' ? '新增商品' : '修改商品'}}</li>
    </ol>
</div><!--/.row-->

<form name="aEGoodsForm" form-validate>
    <div class="pl-20">
        <div class="clearfix h-30px mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品名字<i class="cor-red mr-5">*</i>：</div>
            <div class="f-l ml-10">
                <input type="text" class="pt-5 pb-5 pl-10 pr-10 w-500px" ng-model="getData.title" name="oldtext" validate='{"required" : "请输入商品名字"}' required>
            </div>
        </div>
        <label class="clearfix h-30px mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品分类<i class="cor-red mr-5">*</i>：</div>
            <div class="f-l ml-10">
                <select class="select w-150px" ng-model="getData.categoryId" ng-options="categoryItem.id as categoryItem.name for categoryItem in viewData.categoryData" name="categoryId" validate='{"required" : "请选择商品分类"}' required>
                    <option value="" selected>请选择分类</option>
                </select>
            </div>
        </label>
        <label class="clearfix h-30px mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品原价<i class="cor-red mr-5">*</i>：</div>
            <div class="f-l ml-10">
                <span>
                   <input type="text" class="pt-5 pb-5 pl-10 pr-10 w-100px mr-5" ng-model="getData.price" name="price" validate='{"required" : "请输入商品价格"}' required>元
                </span>

                <select class="select w-150px ml-10 mr-10" ng-model="getData.promotionType" ng-options="typeItem.id as typeItem.name for typeItem in viewData.promotionTypeData">
                    <option value="" selected>不参与促销</option>
                </select>

                 <span ng-show="getData.promotionType === 'single:depreciate'">
                   销售价<input type="text" class="pt-5 pb-5 pl-10 pr-10 w-100px  mr-5" ng-model="getData.presentPrice">元
                </span>

                <span ng-show="getData.promotionType === 'single:discount'">
                   折扣价<input type="text" class="pt-5 pb-5 pl-10 pr-10 w-100px  mr-5" ng-model="getData.discount">不填写则无折扣!
                </span>
            </div>
        </label>
        <label class="clearfix h-30px mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品重量<i class="cor-red mr-5">*</i>：</div>
            <div class="f-l ml-10">
                <span>
                   <input type="text" class="pt-5 pb-5 pl-10 pr-10 w-100px mr-5" ng-model="getData.weight" name="weight" validate='{"required" : "请输入商品重量"}' required>KG
                </span>

                 <span class="ml-10">
                   库存<input type="text" class="pt-5 pb-5 pl-10 pr-10 w-100px ml-5" ng-model="getData.inventory" name="inventory" validate='{"required" : "请输入商品库存"}' required >
                </span>
            </div>
        </label>

        <label class="clearfix h-30px mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">物流费用<i class="cor-red mr-5">*</i>：</div>
            <div class="f-l ml-10">
                <select class="select w-150px mr-10" ng-model="getData.freightId" ng-options="freightItem.id as freightItem.name for freightItem in freightList" name="freightList" validate='{"required" : "请选择物流模版"}' required >
                    <option value="" selected>请选择运费模版</option>
                </select>
                <a class="btn btn-base" href="javascript:;">新增模版运费</a>
            </div>
        </label>
        <div class="clearfix mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">是否上架：</div>
            <div class="f-l ml-10">
                <input type="checkbox" ng-model="getData.shelves">
            </div>
        </div>

        <div class="clearfix mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品图片：</div>
            <div class="f-l ml-10">
                <div class="h-100px w-100px d-ib mr-10" ng-repeat="item in viewData.upLoadImg track by $index" ngf-select="upload($file,$index)" ngf-select ng-model="file" name="file1" ngf-pattern="'image/*'"
                     ngf-accept="'image/*'" ngf-max-size="20MB" ngf-min-height="100"
                     ngf-resize="{width: 100, height: 100}">
                    <i class="goodsPicList"><em ng-click="unimg($index)">X</em><img ng-src="{{item}}"></i>
                </div>
                <button class="upBtn" ngf-select="upload($file)" ngf-select ng-model="file" name="file1" ngf-pattern="'image/*'" ngf-accept="'image/*'" ngf-min-height="750">上传图片750*750</button>
            </div>
        </div>
        <label class="clearfix mt-15 d-b">
            <div class="f-l w-100px ta-r fw-b">商品描述：</div>
            <div class="f-l w-600px ml-10">
                <!--<textarea class="pt-5 pb-5 pl-10 pr-10 w-100" style="height: 300px;" ng-model="getData.descr"></textarea>-->
                <textarea id="editor" name="content" class="editor" style="width: 750px; height: 400px">

                </textarea>
            </div>
        </label>
    </div>
    <div class="mt-20 mb-30 ta-c">
        <button class="btn br-5" form-submit="submit()">提交</button>
    </div>
</form>
